#ifndef _communicate_h
#define _communicate_h

#include "headfile.h"

#define BUFF_MAX_SIZE 200

extern struct buffer uart_buff;

// 缓冲区是否满
bool is_buffer_full(struct buffer *buf);

// 缓冲区是空
bool is_buffer_empty(struct buffer *buf);

// 写入
bool write_buffer(struct buffer *buf, uint8_t *data);

// 读取
bool read_buffer(struct buffer *buf, uint8_t *data);

// 获取缓冲区已有长度
uint8_t get_buffer_len(struct buffer *buf);

// 读取len长度个字节
uint8_t read_several_buffer(struct buffer *buf,uint8_t *read_arry,uint8_t len);

// 清空缓冲区
void clear_buffer();

#endif